package com.system.neural.controller;

import com.system.neural.service.ParseService;
import com.system.neural.utils.RemoveHtmlTagUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * ClassName: ParseController
 * FileName: ParseController.java
 * Description: 解析控制器
 * History:
 * 版本号 			作者 			日期       				简介
 * 1.0				znlccy		    2021/10/5 22:16		    create
 */
@Slf4j
@RestController
@RequestMapping(value="/parse")
@CrossOrigin
public class ParseController {

    /**
     * 依赖ParseService
     */
    @Autowired
    private ParseService parseService;

    /**
     * 解析评价
     * @param comment
     */
    @GetMapping(value = "/comment")
    public String analyseComment(@RequestParam String comment) throws Exception {

        // 转换字符串内容
        String commentStr = RemoveHtmlTagUtil.removeHTMLTag(comment);
//        System.out.println(comment);
        // 解析文本内容
        parseService.parseComment(commentStr);
        return "success";
    }
}
